package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.WRecordTransferInMapper;
import com.ruoyi.system.domain.api.WRecordTransferIn;
import com.ruoyi.system.service.IWRecordTransferInService;

/**
 * 内转记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class WRecordTransferInServiceImpl implements IWRecordTransferInService 
{
    @Autowired
    private WRecordTransferInMapper wRecordTransferInMapper;

    /**
     * 查询内转记录
     * 
     * @param id 内转记录主键
     * @return 内转记录
     */
    @Override
    public WRecordTransferIn selectWRecordTransferInById(Long id)
    {
        return wRecordTransferInMapper.selectWRecordTransferInById(id);
    }

    /**
     * 查询内转记录列表
     * 
     * @param wRecordTransferIn 内转记录
     * @return 内转记录
     */
    @Override
    public List<WRecordTransferIn> selectWRecordTransferInList(WRecordTransferIn wRecordTransferIn)
    {
        return wRecordTransferInMapper.selectWRecordTransferInList(wRecordTransferIn);
    }

    /**
     * 新增内转记录
     * 
     * @param wRecordTransferIn 内转记录
     * @return 结果
     */
    @Override
    public int insertWRecordTransferIn(WRecordTransferIn wRecordTransferIn)
    {
        wRecordTransferIn.setCreateTime(DateUtils.getNowDate());
        return wRecordTransferInMapper.insertWRecordTransferIn(wRecordTransferIn);
    }

    /**
     * 修改内转记录
     * 
     * @param wRecordTransferIn 内转记录
     * @return 结果
     */
    @Override
    public int updateWRecordTransferIn(WRecordTransferIn wRecordTransferIn)
    {
        return wRecordTransferInMapper.updateWRecordTransferIn(wRecordTransferIn);
    }

    /**
     * 批量删除内转记录
     * 
     * @param ids 需要删除的内转记录主键
     * @return 结果
     */
    @Override
    public int deleteWRecordTransferInByIds(Long[] ids)
    {
        return wRecordTransferInMapper.deleteWRecordTransferInByIds(ids);
    }

    /**
     * 删除内转记录信息
     * 
     * @param id 内转记录主键
     * @return 结果
     */
    @Override
    public int deleteWRecordTransferInById(Long id)
    {
        return wRecordTransferInMapper.deleteWRecordTransferInById(id);
    }

    @Override
    public Integer selectWRecordTransferInTotal(String createTime) {
        return wRecordTransferInMapper.selectWRecordTransferInTotal(createTime);
    }
}
